package com.jinzhi.jzweb.controller;


import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.jinzhi.common.annotation.Log;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.common.service.DictService;
import com.jinzhi.common.utils.EhCacheUtil;
import com.jinzhi.common.utils.Result;
import com.jinzhi.jzweb.domain.ExaminationBatchComDO;
import com.jinzhi.jzweb.domain.ExaminationBatchComSDO;
import com.jinzhi.jzweb.domain.ExaminationResultsComDO;
import com.jinzhi.jzweb.domain.StuSignUpComDO;
import com.jinzhi.jzweb.pojo.ErroeDownVo;
import com.jinzhi.jzweb.pojo.ExaminationResultsPoVo;
import com.jinzhi.jzweb.pojo.OneLevelComVO;
import com.jinzhi.jzweb.service.*;
import com.jinzhi.sys.service.UserService;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.List;

/**
 * 
 * <pre>
 *  实操模块打分
 *  实操裁判打分
 * </pre>
 * <small> 2023-05-05 08:52:02 | lance</small>
 */
@Controller
@RequestMapping("/jzweb/stuSignUpScoring")
public class StuSignUpComScoringController extends BaseController {
	@Autowired
	private StuSignUpComService stuSignUpComService;

	@Autowired
	private StuSignUpComService stuSignUpService;
	@Autowired
	private UserService userService;
	@Autowired
	private DictService dictService;
//	@Autowired
//	private ExaminationBatchService examinationBatchService;
	@Autowired
	private ExaminationResultsComService examinationResultsService;
	@Autowired
	private ExaminationBatchComService  examinationBatchComDO;


	@Autowired
	private ExaminationBatchComSService examinationBatchComSService;


	/**
	 * 裁判评分查看列表
	 *
	 * @return
	 */
	@GetMapping("/resultListYesOrNo")
	@ResponseBody
	Object  resultListYesOrNo(Long id){
		ExaminationBatchComSDO examinationBatchComSDO= examinationBatchComSService.selectById(id);

		ExaminationBatchComDO selectById=examinationBatchComDO.selectById(examinationBatchComSDO.getPId());

		if(selectById.getCbatchId()==null){
			return Result.fail("未进行理论考试关联不能进行评分！");
		}
		if(selectById.getState()!=4&&selectById.getState()!=5&&selectById.getState()!=6&&selectById.getState()!=1){
			return Result.fail("该考试批次状态无法进行评分！");
		}
		Wrapper<ExaminationResultsComDO> wrapper=new EntityWrapper<>();
		wrapper.eq("ebatch_id",selectById.getCbatchId());
		List list=examinationResultsService.selectList(wrapper);
		if(list.size()==0){
			return Result.fail("未进行理论考试阅卷不能进行评分！");
		}
		return Result.ok();
	}


	@GetMapping( "/stuSignUpScoringAC")
	@RequiresPermissions("jzweb:stuSignUpScoring:stuSignUpScoringAC")
	String StuSignUpComC(Long id ,Model model){
		//ExaminationBatchComDO selectById=examinationBatchComDO.selectById(id);
		//List<ExaminationResultsPoVo>  list=	examinationResultsService.resultList(selectById.getCbatchId());
		List<ExaminationResultsPoVo>  list= examinationResultsService.resultList(id);
		model.addAttribute("stuSignUpCom",list);
		model.addAttribute("network","主题网络图设计");
		model.addAttribute("activity","集体教学活动设计");
		model.addAttribute("lecture","说课");
		model.addAttribute("courseware","幼儿园保教活动课件制作");
		model.addAttribute("teaching","模拟教学");
		return "jzweb/stuSignUpCom/shotrating";
	}




	/**
	 * 实操裁判A1 打分
	 * @return
	 */
	@GetMapping("/scoingb1")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingb1")
	Result<String>  scoingb(Long id,Double scoingb1,Double scoingb1s,String teachingVideoA1,String teachingPictureA1,
							String coursewareVideoA1,String coursewarePictureA1){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingb1!=null){
			examinationAnswerSheetDOs.get(0).setScoingb1(scoingb1);
		}
		if(scoingb1s!=null){
			examinationAnswerSheetDOs.get(0).setScoingb1s(scoingb1s);
		}
		if(teachingVideoA1!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA1(teachingVideoA1);
		}
		if(teachingVideoA1!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA1(teachingVideoA1);
		}
		if(teachingPictureA1!=null){
			examinationAnswerSheetDOs.get(0).setTeachingPictureA1(teachingPictureA1);
		}
		if(coursewareVideoA1!=null){
			examinationAnswerSheetDOs.get(0).setCoursewareVideoA1(coursewareVideoA1);
		}
		if(coursewarePictureA1!=null){
			examinationAnswerSheetDOs.get(0).setCoursewarePictureA1(coursewarePictureA1);
		}

		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}



	/**
	 * 裁判评分查看列表
	 *
	 * @return
	 */
	@GetMapping("/resultList")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:resultList")
	Object  resultList(Long id){
		List<ExaminationResultsPoVo> list=examinationResultsService.resultList(id);
		return Result.ok(list);
	}

	/**
	 * 实操裁判A2 打分
	 * @return
	 */
	@GetMapping("/scoingb2")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingb2")
	Result<String>  scoingb2(Long id,Double scoingb2,Double scoingb2s,String teachingVideoA2,String teachingPictureA2,
							 String coursewareVideoA2,String coursewarePictureA2){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingb2!=null){
			examinationAnswerSheetDOs.get(0).setScoingb2(scoingb2);
		}

		if(scoingb2s!=null){
			examinationAnswerSheetDOs.get(0).setScoingb2s(scoingb2s);
		}
		if(teachingVideoA2!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA2(teachingVideoA2);
		}
		if(teachingVideoA2!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA2(teachingVideoA2);
		}
		if(teachingPictureA2!=null){
			examinationAnswerSheetDOs.get(0).setTeachingPictureA2(teachingPictureA2);
		}
		if(coursewareVideoA2!=null){
			examinationAnswerSheetDOs.get(0).setCoursewareVideoA2(coursewareVideoA2);
		}
		if(coursewarePictureA2!=null){
			examinationAnswerSheetDOs.get(0).setCoursewarePictureA2(coursewarePictureA2);
		}

		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}

	/**
	 * 实操裁判A3 打分
	 * @return
	 */
	@GetMapping("/scoingb3")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingb3")
	Result<String>  scoingb3(Long id,Double scoingb3,Double scoingb3s,String teachingVideoA3,String teachingPictureA3,
							 String coursewareVideoA3,String coursewarePictureA3){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingb3!=null){
			examinationAnswerSheetDOs.get(0).setScoingb3(scoingb3);
		}
		if(scoingb3s!=null){
			examinationAnswerSheetDOs.get(0).setScoingb3s(scoingb3s);
		}
		if(teachingVideoA3!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA3(teachingVideoA3);
		}
		if(teachingVideoA3!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA3(teachingVideoA3);
		}
		if(teachingPictureA3!=null){
			examinationAnswerSheetDOs.get(0).setTeachingPictureA3(teachingPictureA3);
		}
		if(coursewareVideoA3!=null){
			examinationAnswerSheetDOs.get(0).setCoursewareVideoA3(coursewareVideoA3);
		}
		if(coursewarePictureA3!=null){
			examinationAnswerSheetDOs.get(0).setCoursewarePictureA3(coursewarePictureA3);
		}


		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}

	/**
	 * 实操裁判A5 打分
	 * @return
	 */
	@GetMapping("/scoingb5")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingb5")
	Result<String>  scoingb5(Long id,Double scoingb5,Double scoingb5s,String teachingVideoA5,String teachingPictureA5,
							 String coursewareVideoA5,String coursewarePictureA5){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingb5!=null){
			examinationAnswerSheetDOs.get(0).setScoingb5(scoingb5);
		}
		if(scoingb5s!=null){
			examinationAnswerSheetDOs.get(0).setScoingb5s(scoingb5s);
		}
		if(teachingVideoA5!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA5(teachingVideoA5);
		}
		if(teachingVideoA5!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA5(teachingVideoA5);
		}
		if(teachingPictureA5!=null){
			examinationAnswerSheetDOs.get(0).setTeachingPictureA5(teachingPictureA5);
		}
		if(coursewareVideoA5!=null){
			examinationAnswerSheetDOs.get(0).setCoursewareVideoA5(coursewareVideoA5);
		}
		if(coursewarePictureA5!=null){
			examinationAnswerSheetDOs.get(0).setCoursewarePictureA5(coursewarePictureA5);
		}


		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}


	/**
	 * 实操裁判A4 打分
	 * @return
	 */
	@GetMapping("/scoingb4")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingb4")
	Result<String>  scoingb4(Long id,Double scoingb4,Double scoingb4s,String teachingVideoA4,String teachingPictureA4,
							 String coursewareVideoA4,String coursewarePictureA4){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingb4!=null){
			examinationAnswerSheetDOs.get(0).setScoingb4(scoingb4);
		}
		if(scoingb4s!=null){
			examinationAnswerSheetDOs.get(0).setScoingb4s(scoingb4s);
		}
		if(teachingVideoA4!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA4(teachingVideoA4);
		}
		if(teachingVideoA4!=null){
			examinationAnswerSheetDOs.get(0).setTeachingVideoA4(teachingVideoA4);
		}
		if(teachingPictureA4!=null){
			examinationAnswerSheetDOs.get(0).setTeachingPictureA4(teachingPictureA4);
		}
		if(coursewareVideoA4!=null){
			examinationAnswerSheetDOs.get(0).setCoursewareVideoA4(coursewareVideoA4);
		}
		if(coursewarePictureA4!=null){
			examinationAnswerSheetDOs.get(0).setCoursewarePictureA4(coursewarePictureA4);
		}


		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}



	/**
	 * 实操裁判C1打分
	 * @return
	 */
	@GetMapping("/scoingc1")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingc1")
	Result<String>  scoingc(Long id,Double scoingc1,Double scoingc1s,Double scoingc1ls,
							String newworkVideoC1,String newworkPictureC1,
							String activityVideoC1,String activityPictureC1,
							String lectureVideoC1,String lecturePictureC1){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingc1!=null){
			examinationAnswerSheetDOs.get(0).setScoingc1(scoingc1);
		}
		if(scoingc1s!=null){
			examinationAnswerSheetDOs.get(0).setScoingc1s(scoingc1s);
		}
		if(scoingc1ls!=null){
			examinationAnswerSheetDOs.get(0).setScoingc1ls(scoingc1ls);
		}

		if(newworkVideoC1!=null){
			examinationAnswerSheetDOs.get(0).setNewworkVideoC1(newworkVideoC1);
		}
		if(newworkPictureC1!=null){
			examinationAnswerSheetDOs.get(0).setNewworkPictureC1(newworkPictureC1);
		}
		if(activityVideoC1!=null){
			examinationAnswerSheetDOs.get(0).setActivityVideoC1(activityVideoC1);
		}
		if(activityPictureC1!=null){
			examinationAnswerSheetDOs.get(0).setActivityPictureC1(activityPictureC1);
		}
		//裁判1说课C裁判视频、图片
		if(lectureVideoC1!=null){
			examinationAnswerSheetDOs.get(0).setLecturVideoC1(lectureVideoC1);
		}
		if(lecturePictureC1!=null){
			examinationAnswerSheetDOs.get(0).setLecturePictureC1(lecturePictureC1);
		}

		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}

	/**
	 * 实操裁判C2打分
	 * @return
	 */
	@GetMapping("/scoingc2")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingc2")
	Result<String>  scoingc2(Long id,Double scoingc2,Double scoingc2s,Double scoingc2ls,
							 String newworkVideoC2,String newworkPictureC2,
							 String activityVideoC2,String activityPictureC2,
							 String lectureVideoC2,String lecturePictureC2){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingc2!=null){
			examinationAnswerSheetDOs.get(0).setScoingc2(scoingc2);
		}
		if(scoingc2s!=null){
			examinationAnswerSheetDOs.get(0).setScoingc2s(scoingc2s);
		}
		if(scoingc2ls!=null){
			examinationAnswerSheetDOs.get(0).setScoingc2ls(scoingc2ls);
		}

		if(newworkVideoC2!=null){
			examinationAnswerSheetDOs.get(0).setNewworkVideoC2(newworkVideoC2);
		}
		if(newworkPictureC2!=null){
			examinationAnswerSheetDOs.get(0).setNewworkPictureC2(newworkPictureC2);
		}
		if(activityVideoC2!=null){
			examinationAnswerSheetDOs.get(0).setActivityVideoC2(activityVideoC2);
		}
		if(activityPictureC2!=null){
			examinationAnswerSheetDOs.get(0).setActivityPictureC2(activityPictureC2);
		}
		//裁判1说课C裁判视频、图片
		if(lectureVideoC2!=null){
			examinationAnswerSheetDOs.get(0).setLecturVideoC2(lectureVideoC2);
		}
		if(lecturePictureC2!=null){
			examinationAnswerSheetDOs.get(0).setLecturePictureC2(lecturePictureC2);
		}
		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}



	/**
	 * 实操裁判C3打分
	 * @return
	 */
	@GetMapping("/scoingc3")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingc3")
	Result<String>  scoingc3(Long id,Double scoingc3,Double scoingc3s,Double scoingc3ls,
							 String newworkVideoC3,String newworkPictureC3,
							 String activityVideoC3,String activityPictureC3,
							 String lectureVideoC3,String lecturePictureC3){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingc3!=null){
			examinationAnswerSheetDOs.get(0).setScoingc3(scoingc3);
		}
		if(scoingc3s!=null){
			examinationAnswerSheetDOs.get(0).setScoingc3s(scoingc3s);
		}
		if(scoingc3ls!=null){
			examinationAnswerSheetDOs.get(0).setScoingc3ls(scoingc3ls);
		}

		if(newworkVideoC3!=null){
			examinationAnswerSheetDOs.get(0).setNewworkVideoC3(newworkVideoC3);
		}
		if(newworkPictureC3!=null){
			examinationAnswerSheetDOs.get(0).setNewworkPictureC3(newworkPictureC3);
		}
		if(activityVideoC3!=null){
			examinationAnswerSheetDOs.get(0).setActivityVideoC3(activityVideoC3);
		}
		if(activityPictureC3!=null){
			examinationAnswerSheetDOs.get(0).setActivityPictureC3(activityPictureC3);
		}
		//裁判1说课C裁判视频、图片
		if(lectureVideoC3!=null){
			examinationAnswerSheetDOs.get(0).setLecturVideoC3(lectureVideoC3);
		}
		if(lecturePictureC3!=null){
			examinationAnswerSheetDOs.get(0).setLecturePictureC3(lecturePictureC3);
		}

		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}


	/**
	 * 实操裁判C4打分
	 * @return
	 */
	@GetMapping("/scoingc4")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingc4")
	Result<String>  scoingc4(Long id,Double scoingc4,Double scoingc4s,Double scoingc4ls,
							 String newworkVideoC4,String newworkPictureC4,
							 String activityVideoC4,String activityPictureC4,
							 String lectureVideoC4,String lecturePictureC4){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingc4!=null){
			examinationAnswerSheetDOs.get(0).setScoingc4(scoingc4);
		}
		if(scoingc4s!=null){
			examinationAnswerSheetDOs.get(0).setScoingc4s(scoingc4s);
		}
		if(scoingc4ls!=null){
			examinationAnswerSheetDOs.get(0).setScoingc4ls(scoingc4ls);
		}

		if(newworkVideoC4!=null){
			examinationAnswerSheetDOs.get(0).setNewworkVideoC4(newworkVideoC4);
		}
		if(newworkPictureC4!=null){
			examinationAnswerSheetDOs.get(0).setNewworkPictureC4(newworkPictureC4);
		}
		if(activityVideoC4!=null){
			examinationAnswerSheetDOs.get(0).setActivityVideoC4(activityVideoC4);
		}
		if(activityPictureC4!=null){
			examinationAnswerSheetDOs.get(0).setActivityPictureC4(activityPictureC4);
		}
		//裁判1说课C裁判视频、图片
		if(lectureVideoC4!=null){
			examinationAnswerSheetDOs.get(0).setLecturVideoC4(lectureVideoC4);
		}
		if(lecturePictureC4!=null){
			examinationAnswerSheetDOs.get(0).setLecturePictureC4(lecturePictureC4);
		}

		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}


	/**
	 * 实操裁判C5打分
	 * @return
	 */
	@GetMapping("/scoingc5")
	@ResponseBody
	@RequiresPermissions("jzweb:stuSignUpScoring:scoingc5")
	Result<String>  scoingc5(Long id,Double scoingc5,Double scoingc5s,Double scoingc5ls,
							 String newworkVideoC5,String newworkPictureC5,
							 String activityVideoC5,String activityPictureC5,
							 String lectureVideoC5,String lecturePictureC5){

		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("stu_sign_id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		if(scoingc5!=null){
			examinationAnswerSheetDOs.get(0).setScoingc5(scoingc5);
		}
		if(scoingc5s!=null){
			examinationAnswerSheetDOs.get(0).setScoingc5s(scoingc5s);
		}
		if(scoingc5ls!=null){
			examinationAnswerSheetDOs.get(0).setScoingc5ls(scoingc5ls);
		}


		if(newworkVideoC5!=null){
			examinationAnswerSheetDOs.get(0).setNewworkVideoC5(newworkVideoC5);
		}
		if(newworkPictureC5!=null){
			examinationAnswerSheetDOs.get(0).setNewworkPictureC5(newworkPictureC5);
		}
		if(activityVideoC5!=null){
			examinationAnswerSheetDOs.get(0).setActivityVideoC5(activityVideoC5);
		}
		if(activityPictureC5!=null){
			examinationAnswerSheetDOs.get(0).setActivityPictureC5(activityPictureC5);
		}
		//裁判1说课C裁判视频、图片
		if(lectureVideoC5!=null){
			examinationAnswerSheetDOs.get(0).setLecturVideoC5(lectureVideoC5);
		}
		if(lecturePictureC5!=null){
			examinationAnswerSheetDOs.get(0).setLecturePictureC5(lecturePictureC5);
		}
		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}



	@GetMapping()
	@RequiresPermissions("jzweb:stuSignUp:stuSignUp")
	String StuSignUp(Model model) {
		//查询用户角色
		String roleName = getRoleNames();
		if (roleName.contains("超级用户角色")) {
			model.addAttribute("admin", "admin");
		}
		return "jzweb/stuSignUp/stuSignUp";
	}


	/**
	 * 修改分数
	 * @return
	 */
	@GetMapping("/updateScoingABC")
	@ResponseBody
	Result<String>  updateScoingABC(Long id, OneLevelComVO oneLevelComVO){
		if(id == null){
			return 	Result.fail("该考生还未参加考试！");
		}
		List<ExaminationResultsComDO> examinationAnswerSheetDOs = examinationResultsService
				.findByKv("id", id);
		if(examinationAnswerSheetDOs.size()==0){
			return 	Result.fail("未进行阅卷不能进行评分！");
		}
		//修改B赛场分数
		if(oneLevelComVO.getScoinga1()>=0){
			examinationAnswerSheetDOs.get(0).setScore1(oneLevelComVO.getScoinga1());
		}
		if(oneLevelComVO.getScoinga2()>=0){
			examinationAnswerSheetDOs.get(0).setScore2(oneLevelComVO.getScoinga2());
		}
		if(oneLevelComVO.getScoinga3()>=0){
			examinationAnswerSheetDOs.get(0).setScore3(oneLevelComVO.getScoinga3());
		}
		if(oneLevelComVO.getScoinga4()>=0){
			examinationAnswerSheetDOs.get(0).setScore4(oneLevelComVO.getScoinga4());
		}
		if(oneLevelComVO.getScoinga5()>=0){
			examinationAnswerSheetDOs.get(0).setScore5(oneLevelComVO.getScoinga5());
		}
		if(oneLevelComVO.getScoinga1s()>=0){
			examinationAnswerSheetDOs.get(0).setScore1s(oneLevelComVO.getScoinga1s());
		}
		if(oneLevelComVO.getScoinga2s()>=0){
			examinationAnswerSheetDOs.get(0).setScore2s(oneLevelComVO.getScoinga2s());
		}
		if(oneLevelComVO.getScoinga3s()>=0){
			examinationAnswerSheetDOs.get(0).setScore3s(oneLevelComVO.getScoinga3s());
		}
		if(oneLevelComVO.getScoinga4s()>=0){
			examinationAnswerSheetDOs.get(0).setScore4s(oneLevelComVO.getScoinga4s());
		}
		if(oneLevelComVO.getScoinga5s()>=0){
			examinationAnswerSheetDOs.get(0).setScore5s(oneLevelComVO.getScoinga5s());
		}

		//修改A赛场分数
		if(oneLevelComVO.getScoingb1()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb1(oneLevelComVO.getScoingb1());
		}
		if(oneLevelComVO.getScoingb2()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb2(oneLevelComVO.getScoingb2());
		}
		if(oneLevelComVO.getScoingb3()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb3(oneLevelComVO.getScoingb3());
		}
		if(oneLevelComVO.getScoingb4()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb4(oneLevelComVO.getScoingb4());
		}
		if(oneLevelComVO.getScoingb5()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb5(oneLevelComVO.getScoingb5());
		}

		if(oneLevelComVO.getScoingb1s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb1s(oneLevelComVO.getScoingb1s());
		}
		if(oneLevelComVO.getScoingb2s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb2s(oneLevelComVO.getScoingb2s());
		}
		if(oneLevelComVO.getScoingb3s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb3s(oneLevelComVO.getScoingb3s());
		}
		if(oneLevelComVO.getScoingb4s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb4s(oneLevelComVO.getScoingb4s());
		}
		if(oneLevelComVO.getScoingb5s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingb5s(oneLevelComVO.getScoingb5s());
		}

		//修改C赛场分数
		if(oneLevelComVO.getScoingc1()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc1(oneLevelComVO.getScoingc1());
		}
		if(oneLevelComVO.getScoingc2()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc2(oneLevelComVO.getScoingc2());
		}
		if(oneLevelComVO.getScoingc3()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc3(oneLevelComVO.getScoingc3());
		}
		if(oneLevelComVO.getScoingc4()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc4(oneLevelComVO.getScoingc4());
		}
		if(oneLevelComVO.getScoingc5()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc5(oneLevelComVO.getScoingc5());
		}


		if(oneLevelComVO.getScoingc1s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc1s(oneLevelComVO.getScoingc1s());
		}
		if(oneLevelComVO.getScoingc2s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc2s(oneLevelComVO.getScoingc2s());
		}
		if(oneLevelComVO.getScoingc3s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc3s(oneLevelComVO.getScoingc3s());
		}
		if(oneLevelComVO.getScoingc4s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc4s(oneLevelComVO.getScoingc4s());
		}
		if(oneLevelComVO.getScoingc5s()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc5s(oneLevelComVO.getScoingc5s());
		}

		if(oneLevelComVO.getScoingc1ls()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc1ls(oneLevelComVO.getScoingc1ls());
		}
		if(oneLevelComVO.getScoingc2ls()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc2ls(oneLevelComVO.getScoingc2ls());
		}
		if(oneLevelComVO.getScoingc3ls()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc3ls(oneLevelComVO.getScoingc3ls());
		}
		if(oneLevelComVO.getScoingc4ls()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc4ls(oneLevelComVO.getScoingc4ls());
		}
		if(oneLevelComVO.getScoingc5ls()>=0){
			examinationAnswerSheetDOs.get(0).setScoingc5ls(oneLevelComVO.getScoingc5ls());
		}


		boolean b = examinationResultsService.updateById(examinationAnswerSheetDOs.get(0));
		return b==true?Result.ok():Result.fail();
	}





	@ResponseBody
	@GetMapping("/list")
	@RequiresPermissions("jzweb:stuSignUpScoring:stuSignUpScoring")
	public Object list(StuSignUpComDO stuSignUpComDTO){
		// 查询列表数据
//		Page<StuSignUpComDO> page = stuSignUpComService.selectPage(getPage(StuSignUpComDO.class),
//					stuSignUpComService.convertToEntityWrapper().eq("types",stuSignUpComDTO.getTypes()).orderBy("id", false));
//
		List <StuSignUpComDO>stuSignUpComDOS=	stuSignUpComService.findByKv("types",stuSignUpComDTO.getTypes());

//		List<StuSignUpComDO> list = new ArrayList();
//		for (StuSignUpComDO li:stuSignUpComDOS ) {
//
//				list.add();
//		}
        return Result.ok(stuSignUpComDOS);
	}






	/**
	 * 导出错误信息
	 *
	 * @param request
	 * @param response
	 * @throws Exception
	 * @author kl
	 */
	@Log("导出错误信息")
	@GetMapping("/importComError")
	@ResponseBody
	@Transactional
	@RequiresPermissions("jzweb:stuSignUpScoring:import")
	public void download(HttpServletRequest request, HttpServletResponse response) throws Exception {
		// 告诉浏览器用什么软件可以打开此文件
		response.setHeader("content-Type", "application/vnd.ms-excel");
		// 下载文件的默认名称
		response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("考生报名导入错误信息", "UTF-8") + ".xls");
		//编码
		response.setCharacterEncoding("UTF-8");
		String jsonArray = EhCacheUtil.get("stuSignComUp" + this.getUserId()).toString();
		JSONArray arrayList = JSONArray.parseArray(jsonArray);
		//转换为目标对象list
		List<ErroeDownVo> groupList = JSONObject.parseArray(arrayList.toJSONString(), ErroeDownVo.class);
		Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ErroeDownVo.class, groupList);
		workbook.write(response.getOutputStream());
	}



}
